// extends 继承

class Person {
    // 构造函数
    constructor(name) {
        this.name = name
    }
    say() { //实例方法
        console.log(`hi, my name is ${this.name}`) 
    }
    static create(name) { //静态方法  注意静态方法是通过构造函数直接调用的this指向没有改变
        return new Person(name)
    }
}

class Student extends Person {
    constructor(name, number) {
        super(name) //super永远指向父类的
        this.number = number
    }
    hello() {
        super.say()
        console.log(`my school number is ${this.number}`)
    }
}

const student1 = new Student('rose', '111')
student1.hello()